package com.ziytek.web.citizen.enums;

import com.ziytek.web.citizen.service.itf.StepAddResponse;
import lombok.Getter;

/**
 * @author fenghx
 * @version 1.0
 * @className StepTypeNoEnum
 * Description:
 * @date 2024/3/15 13:24
 */
@Getter
public enum StepNameEnum implements StepAddResponse {
    /**
     * Description: 工步类型信息
     */
    //cccv-恒流恒压充电,cc-恒流充电,cv-恒压充电,ccd-恒流放电,crd-恒阻放电,cpd-恒功率放电,cpc-恒功率充电,sl-搁置
    STEP_CCCV("cccv", "恒流恒压充电"),
    STEP_CC("cc", "恒流充电"),
    STEP_CV("cv", "恒压充电"),
    STEP_CCD("ccd", "恒流放电"),
    STEP_CRD("crd", "恒阻放电"),
    STEP_CPD("cpd", "恒功率放电"),
    STEP_CPC("cpc", "恒功率充电"),
    STEP_SL("sl", "搁置"),

    OTHER("100", "");

    private final String code;
    private final String desc;

    StepNameEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String getMsg(String code) {
        for (StepNameEnum sp : StepNameEnum.values()) {
            if (sp.getCode().equalsIgnoreCase(code)) {
                return sp.desc;
            }
        }
        return OTHER.getDesc();
    }

    @Override
    public int getPosition(String code) {
        return 0;
    }

    @Override
    public String getCode(String line, int position) {
        return null;
    }
}
